package com.itheima.stock.mapper;

import com.itheima.stock.domain.Stock4EvrDayDomain;
import com.itheima.stock.domain.Stock4MinuteDomain;
import com.itheima.stock.domain.StockUpdownDomain;
import com.itheima.stock.domain.StockWeekKDomain;
import com.itheima.stock.pojo.StockRtInfo;
import com.itheima.stock.pojo.dto.CountAndTimeDto;
import com.itheima.stock.pojo.dto.StockScreenSecond;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.Date;
import java.util.List;
import java.util.Map;

/**
* @author 郭鑫超
* @description 针对表【stock_rt_info(个股详情信息表)】的数据库操作Mapper
* @createDate 2023-02-23 14:40:41
* @Entity com.itheima.stock.pojo.StockRtInfo
*/
@Mapper
public interface StockRtInfoMapper {

    /**
     *  根据当前时间查询股票涨幅榜 （前10条数据）
     * @param curDateTime
     * @return
     */
    List<StockUpdownDomain> selectStockUpDown(@Param("date") Date curDateTime);

    List<StockUpdownDomain> selectStockToLimit(Date date);


    List<CountAndTimeDto> selectStockUp(@Param("up") Integer up,@Param("timeStart")  Date timeStart,@Param("timeEnd")  Date timeEnd);

    List<CountAndTimeDto> selectStockDown(@Param("down") Integer down,@Param("timeStart")  Date timeStart,@Param("timeEnd")  Date timeEnd);

    List<Map<String, Integer>> getStockUpdown(String time);

    List<StockWeekKDomain> getWeekK(@Param("code") String code, @Param("times") List<String> weeks);

    List<Stock4EvrDayDomain> stockCreenDkLine(@Param("code")String stockCode,@Param("start") Date pre20Day,@Param("end") Date lastDate);

    List<Stock4MinuteDomain> stockScreenTimeSharing(@Param("code")String stockCode,@Param("start") Date openDate,@Param("end") Date lastDate);

    StockScreenSecond selectOneByCodeAndDate(@Param("code") String code);

    /**
     * 批量插入功能
     * @param stockRtInfoList
     */
    int insertBatch(List<StockRtInfo> stockRtInfoList);
}




